<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>魏远商城</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<link rel="shortcut icon" href="/favicon.ico">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/my-order.css" />
		<link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="css/mui.min.css" />
	</head>

	<body style="background: #eaeef1;">
		<header class="bar bar-nav return-header" style="width: 100%;">
			<span class="order-back mui-action-back"><img src="img/back-le.png" height="50%"/></span>
			<h1 class="title">设置</h1>
		</header>

		<div class="my-setting-content">
			<div class="my-setting-content-logo">
				<img src="img/logo2.png" alt="" height="60%" />
			</div>
			<p class="my-setting-content-password">修改密码</p>
			<!--<p class="my-setting-content-password">修改绑定号码</p>-->
			<p class="my-setting-content-cancel">用户注销</p>
		</div>
		<script src="js/jquery-3.1.1.min.js"></script>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			//		mui.init({
			//	
			//			beforeback: function(){
			//				console.log(JSON.stringify(plus.webview.getWebviewById('tab-me.html')))
			////				plus.webview.getWebviewById('tab-me.html').reload();
			//			}
			//		});

			//用户注销
			if(localStorage.token == '') {
				$('.my-setting-content-password').css('display', 'none')
			} else {
				$('.my-setting-content-password').css('display', 'inline-block')
			}
			$('.my-setting-content-cancel').on('tap', function() {
				if(localStorage.token == '') {
					mui.toast('用户未登录');
				} else {
					localStorage.token = "";
					localStorage.headphoto = "";
					localStorage.phone = "";
					localStorage.nicheng1 = "";
					localStorage.priseId = "";
					console.log(localStorage.token + '....token');
					console.log(localStorage.headphoto + '....localStorage.headphoto');
					console.log(localStorage.phone + '....localStorage.phone');
					console.log(localStorage.nicheng1 + '....localStorage.nicheng1');

					mui.toast('注销成功');
					//				plus.webview.getWebviewById('tab-me.html').reload();
//					var tabme = plus.webview.getWebviewById('tab-me.html');
//					mui.fire(tabme, 'me');
					mui.back();
				}
			})

			//修改密码
			$('.my-setting-content-password').on('tap', function() {
				console.log($(this).index());
				localStorage.pw = '修改密码';
				//				if($(this).index()==2){
				//					localStorage.pw='修改绑定手机号码';
				//				}else{
				//					localStorage.pw='修改密码';
				//				}
				click('security-change-pwd.html', 'security-change-pwd');
			})

			function click(a, b) {
				mui.openWindow({
					url: a,
					id: b,
					show: {
						aniShow: 'pop-in'
					}
				})
			}
		</script>
	</body>

</html>